/**
 * 
 */
package info.niwota.commons.web;

import info.niwota.commons.acl.AccessControl;
import info.niwota.webapp.acl.PermStore;
import android.content.Context;

/**
 * This class is provided for convenience, Ajax objects  do not have to extend this class.
 * 
 * @author qiangli
 *
 */
public class AjaxObject {

	protected Context ctx;


	public AjaxObject(Context ctx) {
		this.ctx = ctx;
	}


	protected boolean canAccess(int group, String user, String label) {
		String[] pa = PermStore.getPerm(ctx, label);
		String perm = pa[0];
		String emails = pa[1];
		
		return AccessControl.canAccess(group, user, label, perm, emails);
	}
}
